package com.example.myapplication3.audio;

import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.myapplication3.R;
import com.example.myapplication3.audio.bean.AudioItem;
import com.example.myapplication3.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

public class AudioActivity extends BaseActivity {
    private List<AudioItem> datalist;
    private int pageIndex;
    private final int size=24;

    @Override
    public int getLayoutMain() {
        return R.layout.activity_audio;
    }

    @Override
    public void initData() {
        datalist = new ArrayList<>();
    }

    @Override
    public void initView() {

    }

    @Override
    public void initListener() {
        AudioQueryHelper.asynLoadAllAudios(this, pageIndex++, size, new AudioQueryHelper.AudioLoadCallback() {
            @Override
            public void onAudiosLoaded(List<AudioItem> audios) {
                datalist.addAll(audios);

            }
        });
    }
}